<template>
    <div class="home">
        <img src="https://images.dog.ceo/breeds/pembroke/n02113023_3885.jpg" alt="">
    </div>
</template>

<script setup lang="ts" name="Home">
import { onMounted } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter()
onMounted(() => {
    setTimeout(() => {
        /*
         * 在此处编写一段代码,让路由实现跳转
         * 编程式路由导航,脱离 <RouterLink> 实现路由跳转
         * 实际开发中,编程式路由导航 >> <RouterLink>
         */
        router.push('/news')
    }, 3000)
})
</script>
<style scoped>
.home {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}
</style>